package packVistas;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import packLigaDeFutbol.GestorArbitros;
import packLigaDeFutbol.Principal;

import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.factories.FormFactory;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class MenuArbitros extends JDialog {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3309862304520452089L;
	private final JPanel contentPanel = new JPanel();
	private int idArbitro;
	
	public MenuArbitros() {
		setTitle("Men\u00FA Arbitro");
		setResizable(false);
		setModal(true);
		setBounds(100, 100, 197, 153);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_COLSPEC,},
			new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.MIN_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,}));
		{
			JButton cmdConsultar = new JButton("Gestionar Incidencias");
			cmdConsultar.addMouseListener(new MouseAdapter() {
				@Override
				public void mouseClicked(MouseEvent e) {
					GestionarIncidencias gi = new GestionarIncidencias(idArbitro);
					gi.setVisible(true);
				}
			});
			contentPanel.add(cmdConsultar, "2, 2");
		}
		{
			JButton btnNewButton_1 = new JButton("Consultar Datos Liga");
			btnNewButton_1.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					ConsultarDatos cd = new ConsultarDatos();
					cd.setVisible(true);
				}
			});
			contentPanel.add(btnNewButton_1, "2, 4");
		}
		{
			JButton btnNewButton = new JButton("Cerrar");
			btnNewButton.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					dispose();
				}
			});
			contentPanel.add(btnNewButton, "2, 8");
		}
		idArbitro = GestorArbitros.getGestorArbitros().getIDArbitroPorUsuario(Principal.idUsu);
	}
	
	

}
